package com.example.acttask;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.example.acttask.utils.Kits;

import static com.example.acttask.MainActivity.LOG_TAG;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);


        findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SecondActivity.this, ThirdActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

                startActivity(intent);
            }
        });

        int taskId = getTaskId();
        Log.i(LOG_TAG, this.getClass().getSimpleName() + "所在的任务的id为: " + taskId + ", 进程：" + Kits.getCurrentProcessName());
    }
}